Crate ran

source · []

Enums

Functions

Transform an f64 number in [0,1) to the range [min:f64,max:f64)

Generate i64 random number in the interval [min:i64,max:i64], where the interval may span zero. Must be min<max always!

Get random numbers of various smaller unsigned integer types by specifying the number of bits required,
e.g. ran_ubits(16) as u16, etc.

Generate u64 random number in the interval [min,max]. You can recast the result into some smaller type, when you know that it will fit in.

Generate f64 random number in the standardised range [0,1). It can be linearly transformed to any [min,max] range.

Generates vector of size d, of f64 random numbers in [0,1).

Generates vector of size d, of f64 random numbers in [0,1). Bit slower but otherwise superior to ranvf64.

Generates vector of size d, of i64 random numbers in the interval [min,max]. May include zero.

Generates vector of size d, of u8 random numbers in [0,255]. You can similarly recast u64 yourself to any other type.

Generates vector of size d, filled with full range u64 random numbers.

Generates n vectors of size d each, of f64 random numbers in [0,1).

Generates n vectors of size d each, of f64 random numbers in [0,1).

Generates n vectors of size d each, of i64 random numbers in the interval [min,max].

Generates n vectors of size d each, of u8 random numbers in the interval [0,255].

Generates n vectors of size d each, of full range u64 random numbers.

Reset xoshi seeds without changing the main SEED. There is usually no need to reset any already running seeds.

Use this function to initialise SEED and also xoshi seeds X0-X3. The supplied value must be > 0, otherwise nothing will be changed.

Simple SPLITMIX64 fast generator recommended for generating the initial sequence of seeds. Assumes that SEED has been set and uses it. It can generate any sequence of random u64s. Passes the BigCrush test. Adapted from Sebastiano Vigna, 2015.

Possibly the best f64 generator. Translated and modified from: xoshiro256+1.0 algorithm by David Blackman and Sebastiano Vigna (vigna@acm.org), 2018. Also added conversion to f64 output in the range [0,1)

Possibly the best full 64 bits generator. Adapted from xoshiro256** 1.0 algorithm by David Blackman and Sebastiano Vigna (vigna@acm.org), 2018.